import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

public class TestServlet extends HttpServlet {

  public void init() throws ServletException {}

  public void doPost(HttpServletRequest _req, HttpServletResponse _res)
    throws ServletException, IOException {

    _res.setContentType("text/html");
    PrintWriter out = _res.getWriter();

    out.println("<html>");
    out.println("<head>");
    out.println("<title>" + "The First Servlet Example" + "</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("<h2><center>" + "Hello World!" + "</center></h2>");
    out.println("</body>");
    out.println("</html>");
    out.close();    
  }

  public void doGet(HttpServletRequest _req, HttpServletResponse _res)
    throws ServletException, IOException {
    doPost(_req, _res); 
  }

  public void destroy() {}

}
